<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="yes" name="apple-touch-fullscreen">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no,email=no" name="format-detection">
		<meta name="full-screen" content="yes">
		<meta name="msapplication-tap-highlight" content="no">
		<!--[if lt IE 9]> 
		<script src=http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script> 
		<![endif]-->
		<title>add6</title>
		<link rel="stylesheet" type="text/css" href="../css/swiper3.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/home.css" />
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
		<script src="../js/jquery.min.js"></script>
		<!--<script src="../js/carousel.js"></script>-->
		<script src="../js/init.js"></script>
		<link rel="icon" href="../images/favicon.ico" />
		<style type="text/css">
			.top {
				position: relative;
				text-align: center;
				background-color: #000;
				color: #fff;
			}
			
			.top .co {
				display: block;
				font-size: 0.26rem;
				height: 0.96rem;
				line-height: 0.96rem;
				color: #fff;
			}
			
			.top .iconfont {
				position: absolute;
				left: 0.2rem;
				top: 0.32rem;
			}
			
			.img {
				padding: 1.5rem 0;
				background-color: #000;
			}
			
			.img img {
				width: 100%;
				height: 4.22rem;
			}
			
			textarea {
				width: 100%;
				/*width: 21.9rem;*/
				min-height: 3rem;
				padding-top: 0.5rem;
				resize: none;
				outline: none;
				/*border: none;*/
			}
			
			.dingwei {
				position: relative;
				font-size: 0.26rem;
				border-bottom: 1px solid #eee;
			}
			
			.dingwei text {
				top: -0.1rem;
			}
			
			.dingwei #allmap {
				top: -0.1rem;
				background-color: #fff!important;
				margin-left: 0.8rem;
			}
			
			.dingwei .left {
				top: -0.2rem;
				position: absolute;
				left: 0.2rem;
				font-size: 0.5rem;
			}
			
			.dingwei .right {
				top: -0.1rem;
				position: absolute;
				right: 0.2rem;
			}
			
			.btn {
				position: absolute;
				bottom: 0.2rem;
				font-size: 0.3rem;
				display: inline-block;
				width: 90%;
				left: 5%;
				border-radius: 0.5rem;
				height: 0.8rem;
				line-height: 0.8rem;
				text-align: center;
				color: #fff;
				background-color: #a50065;
			}
			
			@font-face {
				font-family: 'iconfont';
				src: url('../font/iconfont.eot');
				src: url('../font/iconfont.eot?#iefix') format('embedded-opentype'), url('../font/iconfont.woff') format('woff'), url('../font/iconfont.ttf') format('truetype'), url('../font/iconfont.svg#iconfont') format('svg');
			}
			
			.iconfont {
				font-family: "iconfont" !important;
				font-size: 16px;
				font-style: normal;
				-webkit-font-smoothing: antialiased;
				-webkit-text-stroke-width: 0.2px;
				-moz-osx-font-smoothing: grayscale;
			}
		</style>
	</head>

	<body>
		<div class="top">
			<text class="iconfont">&#xe601;</text>
			<text class="co">共享照片</text>
		</div>
		<div class="img">
			<img src="../images/con6.jpg" />
		</div>
		<textarea name="" rows="" cols="" placeholder="添加描述"></textarea>
		<div class="dingwei">
			<text class="left iconfont">&#xe62f;</text>
			<text id="allmap"></text><text class="right iconfont">&#xe633;</text>
		</div>
		<text class="btn">发布</text>
	</body>
	<script src="../js/jquery.min.js"></script>
	<!--<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DD279b2a90afdf0ae7a3796787a0742e"></script>-->
	<script type="text/javascript" src="../js/baidumapapi.js"></script>
	<script type="text/javascript">
		navigator.geolocation.getCurrentPosition(function(position) {
			var lat = position.coords.latitude;
			var lng = position.coords.longitude;
			console.log(lat)
			console.log(lng)
			map_click(lng, lat)
		});

		function map_click(lng, lat) {
			var map = new BMap.Map('allmap');
			var point = new BMap.Point(lng, lat);
			map.centerAndZoom(point, 12);
			var geoc = new BMap.Geocoder();
			geoc.getLocation(point, function(rs) {
				var addComp = rs.addressComponents;
				console.log(addComp)
				console.log(addComp.city);
				document.getElementById("allmap").innerText = addComp.city;
			});
		}
	</script>

</html>